#
# @lc app=leetcode.cn id=1749 lang=python3
#
# [1749] 任意子数组和的绝对值的最大值
#

# @lc code=start
from itertools import accumulate
from typing import List


class Solution:
    def maxAbsoluteSum(self, nums: List[int]) -> int:
        s = list(accumulate(nums,initial=0))
        return max(s) - min(s) #最大的子数组和减最小的子数组和
# @lc code=end

